<%@ page import="org.springframework.util.ClassUtils" %>

<%@ page import="com.opeace.PersonPerson" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'personPerson.label', default: 'PersonPerson')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#show-personPerson" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		
        <h1>Relative</h1>
		<table align="center" width="100%">
                  <tr>

		<td align="left" width="50%" style="vertical-align: top;">
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<ol class="property-list personPerson">
			
				<g:if test="${personPersonInstance?.noPickUp}">
				<li class="fieldcontain">
					<span id="noPickUp-label" class="property-label"><g:message code="personPerson.noPickUp.label" default="No Pick Up" /></span>
					
						<span class="property-value" aria-labelledby="noPickUp-label"><g:formatBoolean boolean="${personPersonInstance?.noPickUp}" /></span>
					
				</li>
				</g:if>
			
				<g:if test="${personPersonInstance?.notes}">
				<li class="fieldcontain">
					<span id="notes-label" class="property-label"><g:message code="personPerson.notes.label" default="Notes" /></span>
					
						<span class="property-value" aria-labelledby="notes-label"><g:fieldValue bean="${personPersonInstance}" field="notes"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${personPersonInstance?.person1}">
				<li class="fieldcontain">
					<span id="person1-label" class="property-label"><g:message code="personPerson.person1.label" default="Person" /></span>
					<g:set var="link" value="${createLink(controller: ClassUtils.getShortName(personPersonInstance?.person1?.getClass())[0].toLowerCase() + ClassUtils.getShortName(personPersonInstance?.person1?.getClass())[1..-1], action: 'show', id: personPersonInstance?.person1.id)}" />
                                        <div class="property-value"><a href="${link}">${personPersonInstance?.person1?.firstName} ${personPersonInstance?.person1?.lastName}</a></div>
					
				</li>
				</g:if>
			
				<g:if test="${personPersonInstance?.person2}">
				<li class="fieldcontain">
					<span id="person2-label" class="property-label"><g:message code="personPerson.person2.label" default="Relative" /></span>
					<g:set var="link" value="${createLink(controller: ClassUtils.getShortName(personPersonInstance?.person2?.getClass())[0].toLowerCase() + ClassUtils.getShortName(personPersonInstance?.person2?.getClass())[1..-1], action: 'show', id: personPersonInstance?.person2.id)}" />
                                        <div class="property-value"><a href="${link}">${personPersonInstance?.person2?.firstName} ${personPersonInstance?.person2?.lastName}</a></div>
					
				</li>
				</g:if>
			
				<g:if test="${personPersonInstance?.pickUp}">
				<li class="fieldcontain">
					<span id="pickUp-label" class="property-label"><g:message code="personPerson.pickUp.label" default="Pick Up" /></span>
					
						<span class="property-value" aria-labelledby="pickUp-label"><g:formatBoolean boolean="${personPersonInstance?.pickUp}" /></span>
					
				</li>
				</g:if>
			
				<g:if test="${personPersonInstance?.relationship}">
				<li class="fieldcontain">
					<span id="relationship-label" class="property-label"><g:message code="personPerson.relationship.label" default="Relationship" /></span>
					
						<span class="property-value" aria-labelledby="relationship-label"><g:fieldValue bean="${personPersonInstance}" field="relationship"/></span>
					
				</li>
				</g:if>
			
			</ol>
			<g:form>
				<fieldset class="buttons">
					<g:hiddenField name="id" value="${personPersonInstance?.id}" />
                                        <g:link class="edit" style="font-size:17px;" action="edit" id="${personPersonInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
					<g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
				</fieldset>
			</g:form>
		 </td>
                  </tr>

	</table>
         <div class="nav" role="navigation">
			<ul>
				
				<li><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
			</ul>
		</div>
</html>
